const Api = require('./api.js');
 export const  againLogin = () => {
	let host = Api.host
	wx.login({
		success(res){
			uni.request({
				url:`${host}/v1/user/applet_login`,
				method: 'POST',
				data:{
					source: 2,
					anonymous_code:res.anonymousCode,
					code: res.code,
				},
				success:function (result)  {
					console.log(result, "测试403")
					
					uni.setStorageSync('is_author', result.data.data.is_author)
					uni.setStorageSync('token', result.data.data.token)
					
					uni.setStorageSync('photo', result.data.data.avatar_url)
					uni.setStorageSync('nickname', result.data.data.nickname)
					uni.setStorageSync('account_hid', result.data.data.account.hid)
					uni.setStorageSync('signature', result.data.data.signature)
				},
				
			})
		
		},
		fail(res) {
			console.log(res, '失败')
		}
	})

}